home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / sbin / env-update.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2006-04-25  |  709b  |  44 lines

  1. #!/bin/bash
  2. # Copyright 1999-2004 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. # $Header$
  5.  
  6. source /etc/init.d/functions.sh || exit 1
  7.  
  8. if [ "${EUID}" -ne 0 ]
  9. then
  10.     eerror "$0: must be root."
  11.     exit 1
  12. fi
  13.  
  14. usage() {
  15. echo "usage: env-update.sh
  16.  
  17. note:
  18.       This utility generates /etc/profile.env and /etc/csh.env
  19.       from the contents of /etc/env.d/
  20. "
  21.     exit 1
  22. }
  23.  
  24. export SVCDIR="${svcdir}"
  25.  
  26. # Only update if files have actually changed
  27. if [ "$1" == "-u" ]
  28. then
  29.     is_older_than "${svcdir}/envcache" /etc/env.d && exit 0
  30.     shift
  31. fi
  32.  
  33. if [ "$#" -ne 0 ]
  34. then
  35.     usage
  36. else
  37.     /bin/gawk \
  38.         -f /lib/rcscripts/awk/functions.awk \
  39.         -f /lib/rcscripts/awk/genenviron.awk
  40. fi
  41.  
  42.  
  43. # vim:ts=4
  44.